import * as ActionTypes from './ActionTypes';
export default (state,action)=>{
    const {counterCaption,level}=action;
    const newState= Object.assign({},state);
    switch(action.type){
        case ActionTypes.INCREMENT:
        newState[counterCaption]= state[counterCaption]+level;
        console.log(newState)
        return newState;
        case ActionTypes.DECREMENT:
        newState[counterCaption]= state[counterCaption]-level;
        return newState;
        default:
        return state;
    }
}